package com.app.teadoor.greendao;


import com.alibaba.fastjson.annotation.JSONField;

public class GreenDaoUtils {


    public static final String TYPE_WATER = "water" //水源管理，包含消火栓、水源
            , TYPE_STATION = "station", TYPE_UNIT = "unit", TYPE_BUILDING = "build", TYPE_TRAIN = "train", TYPE_RISK = "risk"//单位隐患
            , TYPE_USER = "user"//未使用
            , TYPE_PERSON = "person"//仅供警情地图使用  ——》人员
            , TYPE_CAR = "car"//仅供警情地图使用   ——》车辆
            , TYPE_RECAR = "recar"//仅供警情地图使用   ——》警情相关车辆
            , TYPE_SQUADRON = "squadron"//仅供警情地图使用   ——》获取中队列表（实时获取，不加入基础数据）
            ;


//
//    public void clearAll(){
//        alarmInfoBeanDao.deleteAll();
//        deviceCallBeanDao.deleteAll();
//        EventBus.getDefault().post(new GreenDaoUtils.EventDateChange(EventDateChange.TYPE_ALL));
//    }

    public static class EventDateChange {
        public static final String TYPE_ALL = "99";
        public String type;

        public EventDateChange(String type) {
            this.type = type;
        }
    }

    public interface GreenDaoInserCallBack {
        void onDataInsert(int count);
    }

    @JSONField(serialize = false)
    public static String getTypeName(String map_type) {
        switch (map_type) {
            case GreenDaoUtils.TYPE_STATION:
                return "微型消防站";
            case GreenDaoUtils.TYPE_WATER:
                return "水源管理";
            case GreenDaoUtils.TYPE_BUILDING:
                return "建筑信息";
            case GreenDaoUtils.TYPE_UNIT:
                return "单位信息";
            case GreenDaoUtils.TYPE_TRAIN:
                return "单位演练";
            case GreenDaoUtils.TYPE_RISK:
                return "单位隐患";
            default:
                return "未知";
        }
    }
}
